package com.mioto.ld.module.device.service.impl;

import com.mioto.ld.module.device.model.DeviceLocationVO;
import com.mioto.ld.utils.BaseUtil;
import org.springframework.stereotype.Service;

import com.mioto.ld.module.device.dao.DeviceAddressDao;
import com.mioto.ld.module.device.model.DeviceAddress;
import com.mioto.ld.module.device.service.IDeviceAddressService;
import javax.annotation.Resource;
import java.util.List;

/**
 *
 * @author mioto
 * @date 2024-06-08 14:16:29
 */
@Service("deviceAddressService")
public class DeviceAddressServiceImpl implements IDeviceAddressService{

    @Resource
    private DeviceAddressDao deviceAddressDao;

    @Override
    public List<DeviceLocationVO> findListByProductType(Integer productType) {
        return deviceAddressDao.findListByProductType(productType, BaseUtil.buildUserFilterCondition());
    }

    @Override
    public List<DeviceAddress> findList(DeviceAddress deviceAddress) {
        return deviceAddressDao.findList(deviceAddress);
    }

    @Override
    public int insert(DeviceAddress deviceAddress) {
        return deviceAddressDao.insertIgnoreNull(deviceAddress);
    }

    @Override
    public int update(DeviceAddress deviceAddress) {
        return deviceAddressDao.update(deviceAddress);
    }

    @Override
    public int updateIgnoreNull(DeviceAddress deviceAddress) {
        return deviceAddressDao.updateIgnoreNull(deviceAddress);
    }

    @Override
    public DeviceAddress findByColumn(String column, Object value) {
        return deviceAddressDao.findByColumn(column,value);
    }

    @Override
    public int deleteByColumn(String column, Object value) {
        return deviceAddressDao.deleteByColumn(column,value);
    }

    @Override
    public int batchDelete(Integer[] ids) {
        return deviceAddressDao.batchDelete(ids);
    }
}